Skip to content

Conversation

@Flare576
Copy link
Contributor

@Flare576 Flare576 commented Feb 3, 2026

Summary

  • Validates Slack tokens on startup via AuthTest() - server now fails fast with clear error message if tokens are invalid/expired
  • Namespaces cache files by TeamID (e.g., T12345_users_cache.json) to prevent cross-workspace cache contamination when switching between Slack workspaces
  • Logs authenticated workspace info on startup for debugging

Problem

Previously, if you had multiple Slack workspaces configured (e.g., one for work, one for personal), they would share the same cache files. This caused several issues:

  1. Silent bad token: If workspace A's cache existed but workspace B's tokens were used, the server would start "successfully" (cache loaded!) but API calls would fail
  2. Cache contamination: Switching between workspaces would overwrite each other's user/channel caches

Solution

  1. Auth validation on startup: Call AuthTest() before loading cache. If auth fails, logger.Fatal() immediately with clear error message
  2. TeamID-prefixed caches: Cache files are now namespaced by workspace: T12345_users_cache.json, T12345_channels_cache_v2.json

Testing

  • With valid tokens: Server starts, logs "Authenticated to Slack" with team/user info
  • With invalid tokens: Server fails immediately with "Authentication failed - check your Slack tokens"
  • Multiple workspaces: Each workspace gets its own cache files

Depends On

@korotovsky
Copy link
Owner

@Flare576 Pls, rebase with master

@Flare576 Flare576 force-pushed the feat/startup-auth-validation branch from b615b74 to f87743f Compare February 6, 2026 12:10
- Validate Slack tokens on startup via AuthTest() - server now fails fast
  with clear error message if tokens are invalid/expired
- Namespace cache files by TeamID (e.g., T12345_users_cache.json) to prevent
  cross-workspace cache contamination when switching between Slack workspaces
- Log authenticated workspace info on startup for debugging
@Flare576 Flare576 force-pushed the feat/startup-auth-validation branch from f87743f to 7afabd5 Compare February 11, 2026 02:01
@korotovsky korotovsky merged commit 6ddc828 into korotovsky:master Feb 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants